import { acceptHMRUpdate, defineStore } from 'pinia'

export const useTokenStore = defineStore('token', () => {
  const token = ref('')

  /**
   * Changes the current value of the token
   * before.
   *
   * @param value - new value to set
   */
  function setToken(value: string) {
    token.value = value
  }

  return {
    token,
    setToken,
  }
})

if (import.meta.hot)
  import.meta.hot.accept(acceptHMRUpdate(useTokenStore, import.meta.hot))
